package com.flame.user.message.exception;

import java.text.MessageFormat;

import com.flame.core.exception.ExceptionLevel;
import com.flame.core.exception.ExceptionMessage;

/**
 * flame_user_message 用户消息表
 *
 * @author 吴欣童
 * @since 2023-02-14 20:28:48
 */
public enum UserMessageExceptionMessage implements ExceptionMessage {
    USERMESSAGE_EXIST("100001", "添加失败，数据已存在", ExceptionLevel.INFO);

    private String code;

    private String message;

    private ExceptionLevel level;

    UserMessageExceptionMessage(String code, String message, ExceptionLevel level) {
        this.code = code;
        this.message = message;
        this.level = level;
    }

    @Override
    public String getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    @Override
    public String getMessage(Object... args) {
        return MessageFormat.format(this.message, args);
    }

    @Override
    public ExceptionLevel getLevel() {
        return level;
    }
}
